package cn.com.clearcloud.order.controller;

import cn.com.clearboot.base.entity.Order;
import cn.com.clearcloud.order.client.UserClient;
import cn.com.clearcloud.order.service.OrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping(value = "/order")
public class OrderController {

    private final OrderService orderService;

    @GetMapping(value = "/createOrder/{userId}/{commodityCode}/{orderCount}")
    public Boolean createOrder(@PathVariable("userId") String userId,
                               @PathVariable("commodityCode") String commodityCode,
                               @PathVariable("orderCount") Integer orderCount) {
        return orderService.create(userId,commodityCode, orderCount);
    }

}
